var t = getApp();

Page({
    data: {
        isIpx: t.globalData.isIpx,
        tabList: [ {
            name: "所有照片",
            isCurrent: !0,
            nums: 0
        }, {
            name: "NICO推荐",
            isCurrent: !1,
            nums: 0
        }, {
            name: "已选精修",
            isCurrent: !1,
            nums: 30
        } ],
        imgList: [ {
            url: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
            selected: !1
        }, {
            url: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
            selected: !1
        }, {
            url: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg",
            selected: !1
        } ],
        photoList: [],
        totalSelected: 0,
        showNext: !0,
        showPay: !1,
        showResult: !1
    },
    onLoad: function(t) {
        list.list.photos.forEach(function(t) {
            t.selected = !1;
        }), console.log(list), this.setData({
            photoList: list.list.photos
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    switchTabHandler: function(t) {
        var e = t.currentTarget.dataset.index;
        this.data.tabList.map(function(t, e) {
            t.isCurrent = !1;
        }), this.data.tabList[e].isCurrent = !0, this.setData({
            tabList: this.data.tabList
        }), wx.pageScrollTo({
            scrollTop: 0,
            duration: 0
        });
    },
    previewImgHandler: function(t) {
        var e = t.currentTarget.dataset.index, s = [];
        this.data.photoList.map(function(t, e) {
            s.push(t.versions.demo.url.large);
        }), wx.previewImage({
            current: this.data.photoList[e].versions.demo.url.large,
            urls: s,
            success: function(t) {},
            fail: function(t) {},
            complete: function(t) {}
        });
    },
    selectTemplateHandler: function(t) {
        var e = this, s = t.currentTarget.dataset.index;
        this.data.photoList[s].selected = !this.data.photoList[s].selected, this.data.totalSelected = 0, 
        this.data.photoList.forEach(function(t) {
            t.selected && e.data.totalSelected++;
        }), this.setData({
            totalSelected: this.data.totalSelected,
            photoList: this.data.photoList
        });
    },
    nextStepHander: function() {
        this.data.showNext = !1, this.data.showPay = !0, this.data.showResult = !1, this.setData({
            showNext: this.data.showNext,
            showPay: this.data.showPay,
            showResult: this.data.showResult
        });
    },
    checkResultHandler: function() {
        wx.navigateTo({
            url: "/pages/template-select-result/template-select-result",
            success: function(t) {},
            fail: function(t) {},
            complete: function(t) {}
        });
    },
    selectHandler: function() {
        wx.navigateTo({
            url: "/pages/template-select-result/template-select-result",
            success: function(t) {},
            fail: function(t) {},
            complete: function(t) {}
        });
    }
});